package com.beyondprototype.websocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@EnableScheduling
@SpringBootApplication
public class StompServer {

    @Autowired
    private SimpMessagingTemplate template;

    public static void main(String[] args) {
        SpringApplication.run(StompServer.class, args);
    }

    //@EventListener(classes = {ApplicationStartedEvent.class})
//    @Scheduled(fixedRate=2000)
//    public void listen() throws Exception {
//        template.convertAndSend("/topic/greetings", "Hello new user");
//    }
}
